<include file="Public/min-header" />
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content ">
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="返回"><i class="fa fa-reply"></i></a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 添加链接</h3>
                </div>
                <div class="panel-body ">
                    <form method="post" id="handleposition" action="{:U('Admin/Article/linkHandle')}">

                        <div class="tab-content col-md-10">
                            <div class="tab-pane active" id="tab_tongyong">
                                <table class="table table-bordered">
                                    <tbody>
                                        <tr>
                                            <td class="col-sm-2" align="right">链接名称：</td>
                                            <td class="col-sm-4">
                                                <input type="text" class="form-control" name="link_name" value="{$info.link_name}">
                                                <span id="err_attr_name" style="color:#F00; display:none;"></span>
                                            </td>
                                            <td class="col-sm-4">请填写友情链接的名称
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">是否显示：</td>
                                            <td>
                                    <input type="radio" class="" name="is_show" value="1" <if condition="$info[is_show] eq 1"> checked="checked"</if>>开启
                                    <input type="radio" class="" name="is_show" value="0" <if condition="$info[is_show] eq 0"> checked="checked"</if>>关闭
                                    </td>
                                    <td class="col-sm-4">是否在前台显示</td>
                                    </tr>
                                    <tr>
                                        <td align="right">是否新窗口打开：</td>
                                        <td>
                                    <input type="radio" class="" name="target" value="1" <if condition="$info[target] eq 1"> checked="checked"</if>>开启
                                    <input type="radio" class="" name="target" value="0" <if condition="$info[target] eq 0"> checked="checked"</if>>关闭
                                    </td>
                                    <td class="col-sm-4">点击链接是否在新窗口打开</td>
                                    </tr>
                                    <tr>
                                        <td align="right">链接LOGO：</td>
                                        <td>
                                            <input type="text" id="imagetext" name="link_logo" value="{$info.link_logo}" class = "input-sm">
                                            <input type="button" class="button" onClick="GetUploadify(1, 'imagetext', 'link', '')" value="上传图片" />
                                        </td>
                                        <td class="col-sm-4">选择友情链接的LOGO</td>
                                    </tr>
                                    <tr>
                                        <td align="right">链接地址：</td>
                                        <td>
                                            <input type="text" class="form-control" name="link_url" value="{$info.link_url}">
                                        </td>
                                        <td class="col-sm-4">友情链接跳转地址</td>
                                    </tr>
                                    <tr>
                                        <td align="right">排序：</td>
                                        <td>
                                            <input type="text" class="form-control" name="orderby" value="{$info.orderby}">
                                        </td>
                                        <td class="col-sm-4">请填写自然数，友情链接会根据排序进行由小到大排列显示</td>
                                    </tr>
                                    </tbody>
                                    <tfoot>
                                        <tr>
                                            <td>
                                                <input type="hidden" name="act" value="{$act}">
                                                <input type="hidden" name="link_id" value="{$info.link_id}">
                                            </td>
                                            <td class="col-sm-4"></td>
                                            <td class="text-right">
                                                <input class="btn btn-primary" type="button" onclick="adsubmit()" value="保存">
                                            </td>
                                        </tr>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
    function adsubmit() {
        if ($('input[name=link_name]').val() == '') {
            layer.msg('链接名称不能为空！', {
                icon: 2,
                time: 1000
            });
            return false;
        }
        if ($('input[name=link_logo]').val() == '') {
            layer.msg('请上传链接LOGO！', {
                icon: 2,
                time: 1000
            });
            return false;
        }
        if ($('input[name=link_url]').val() == '') {
            layer.msg('链接地址不能为空！', {
                icon: 2,
                time: 1000
            });
            return false;
        }
        $('#handleposition').submit();
    }
</script>
</body>

</html>
